home *** CD-ROM | disk | FTP | other *** search
/ AppleScript - The Beta Release / AppleScript - The Beta Release.iso / Development Tools / Interfaces / CIncludes / AppleEvents.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-13  |  25.3 KB  |  701 lines  |  [TEXT/MPS ]

  1. /*****************************************************************
  2.  
  3.  Created: Monday, September 16, 1991 at 2:22 PM
  4.  AppleEvents.h
  5.  C Interface to the Macintosh Libraries
  6.  
  7.  Copyright Apple Computer, Inc. 1989-1992
  8.  All rights reserved
  9.  
  10.  Modified for AppleEvents manager version 1.0.1 Nov 13th, 1992
  11.  
  12. *****************************************************************/
  13.  
  14.  
  15. #ifndef __APPLEEVENTS__
  16. #define __APPLEEVENTS__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22. #ifndef __MEMORY__
  23. #include <Memory.h>
  24. #endif
  25.  
  26. #ifndef __OSUTILS__
  27. #include <OSUtils.h>
  28. #endif
  29.  
  30. #ifndef __EVENTS__
  31. #include <Events.h>
  32. #endif
  33.  
  34. #ifndef __EPPC__
  35. #include <EPPC.h>
  36. #endif
  37.  
  38. #ifndef __NOTIFICATION__
  39. #include <Notification.h>
  40. #endif
  41.  
  42. /*--------------------------------------------------------------
  43.         Apple event descriptor types
  44. --------------------------------------------------------------*/
  45.  
  46. enum {                                                        /* compiler limits us to 20 items within an enum */
  47.     typeBoolean = 'bool',                                    /* enum's are used to avoid conflicts with other header files */
  48.     typeChar = 'TEXT',
  49.     typeSMInt = 'shor',
  50.     typeInteger = 'long',
  51.     typeSMFloat = 'sing',
  52.     typeFloat = 'doub',
  53.     typeLongInteger = 'long',
  54.     typeShortInteger = 'shor',
  55.     typeLongFloat = 'doub',
  56.     typeShortFloat = 'sing',
  57.     typeExtended = 'exte',
  58.     typeComp = 'comp',
  59.     typeMagnitude = 'magn',
  60.     typeAEList = 'list',
  61.     typeAERecord = 'reco',
  62.     typeAppleEvent = 'aevt',
  63.     typeTrue = 'true',
  64.     typeFalse = 'fals',
  65.     typeAlias = 'alis',
  66.     typeEnumerated = 'enum'
  67. };
  68.  
  69. enum {
  70.     typeType = 'type',
  71.     typeAppParameters = 'appa',
  72.     typeProperty = 'prop',
  73.     typeFSS = 'fss ',
  74.     typeKeyword = 'keyw',
  75.     typeSectionH = 'sect',
  76.     typeWildCard = '****',
  77.     typeApplSignature = 'sign',
  78.     typeSessionID = 'ssid',
  79.     typeTargetID = 'targ',
  80.     typeProcessSerialNumber = 'psn ',
  81.     typeNull = 'null'                                        /* null or nonexistent data */
  82. };
  83.  
  84. /*--------------------------------------------------------------
  85.         Keywords for Apple event parameters
  86. --------------------------------------------------------------*/
  87.  
  88. enum {
  89.     keyDirectObject = '----',
  90.     keyErrorNumber = 'errn',
  91.     keyErrorString = 'errs',
  92.     keyProcessSerialNumber = 'psn '
  93. };
  94.  
  95. /*--------------------------------------------------------------
  96.         Keywords for Apple event attributes
  97. --------------------------------------------------------------*/
  98.  
  99. enum {
  100.     keyTransactionIDAttr = 'tran',
  101.     keyReturnIDAttr = 'rtid',
  102.     keyEventClassAttr = 'evcl',
  103.     keyEventIDAttr = 'evid',
  104.     keyAddressAttr = 'addr',
  105.     keyOptionalKeywordAttr = 'optk',
  106.     keyTimeoutAttr = 'timo',
  107.     keyInteractLevelAttr = 'inte',                            /* this attribute is read only - will be set in AESend */
  108.     keyEventSourceAttr = 'esrc',                            /* this attribute is read only */
  109.     keyMissedKeywordAttr = 'miss',                            /* this attribute is read only */
  110.     keyOriginalAddressAttr = 'from'                            /* new in 1.0.1 */
  111. };
  112.  
  113. /*--------------------------------------------------------------
  114.         Keywords for special handlers
  115. --------------------------------------------------------------*/
  116.  
  117. enum {
  118.     keyPreDispatch = 'phac',                                /* preHandler accessor call */
  119.     keySelectProc = 'selh',                                    /* more selector call */
  120.  
  121. /*--------------------------------------------------------------
  122.         Keyword for recording
  123. --------------------------------------------------------------*/
  124.  
  125.     keyAERecorderCount = 'recr',                            /* available only in vers 1.0.1 and greater */
  126.  
  127. /*--------------------------------------------------------------
  128.         Keyword for version information
  129. --------------------------------------------------------------*/
  130.  
  131.     keyAEVersion = 'vers',                                    /* available only in vers 1.0.1 and greater */
  132.  
  133. /*--------------------------------------------------------------
  134.         Event Class
  135. --------------------------------------------------------------*/
  136.  
  137.     kCoreEventClass = 'aevt'
  138. };                                                            /* end of enum */
  139.  
  140. /*--------------------------------------------------------------
  141.         Event ID's
  142. --------------------------------------------------------------*/
  143.  
  144. enum {
  145.     kAEOpenApplication = 'oapp',
  146.     kAEOpenDocuments = 'odoc',
  147.     kAEPrintDocuments = 'pdoc',
  148.     kAEQuitApplication = 'quit',
  149.     kAEAnswer = 'ansr',
  150.     kAEApplicationDied = 'obit'
  151. };
  152.  
  153. /*--------------------------------------------------------------
  154.         Constants for use in AESend mode
  155. --------------------------------------------------------------*/
  156.  
  157. enum {
  158.     kAENoReply = 0x00000001,                                /* sender doesn't want a reply to event */
  159.     kAEQueueReply = 0x00000002,                                /* sender wants a reply but won't wait */
  160.     kAEWaitReply = 0x00000003,                                /* sender wants a reply and will wait */
  161.     kAENeverInteract = 0x00000010,                            /* server should not interact with user */
  162.     kAECanInteract = 0x00000020,                            /* server may try to interact with user */
  163.     kAEAlwaysInteract = 0x00000030,                            /* server should always interact with user where appropriate */
  164.     kAECanSwitchLayer = 0x00000040,                            /* interaction may switch layer */
  165.     kAEDontReconnect = 0x00000080,                            /* don't reconnect if there is a sessClosedErr from PPCToolbox */
  166.     kAEWantReceipt = nReturnReceipt,                        /* sender wants a receipt of message */
  167.     kAEDontRecord = 0x00001000,                                /* don't record this event - available only in vers 1.0.1 and greater */
  168.     kAEDontExecute = 0x00002000,                            /* don't send the event for recording - available only in vers 1.0.1 and greater */
  169.  
  170. /*--------------------------------------------------------------
  171.         Constants for the send priority in AESend
  172. --------------------------------------------------------------*/
  173.  
  174.     kAENormalPriority = 0x00000000,                            /* post message at the end of the event queue */
  175.     kAEHighPriority = nAttnMsg                                /* post message at the front of the event queue */
  176. };                                                            /* end of enum */
  177.  
  178. /*--------------------------------------------------------------
  179.         Constants for recording
  180. --------------------------------------------------------------*/
  181.  
  182. enum {
  183.     kAEStartRecording = 'reca',                                /* available only in vers 1.0.1 and greater */
  184.     kAEStopRecording = 'recc',                                /* available only in vers 1.0.1 and greater */
  185.     kAENotifyStartRecording = 'rec1',                        /* available only in vers 1.0.1 and greater */
  186.     kAENotifyStopRecording = 'rec0',                        /* available only in vers 1.0.1 and greater */
  187.     kAENotifyRecording = 'recr'                                /* available only in vers 1.0.1 and greater */
  188. };
  189.  
  190. /*--------------------------------------------------------------
  191.         Constant for the returnID param of AECreateAppleEvent
  192. --------------------------------------------------------------*/
  193.  
  194. enum {
  195.      kAutoGenerateReturnID = -1,                                /* AECreateAppleEvent will generate a session-unique ID */
  196.  
  197. /*--------------------------------------------------------------
  198.         Constant for transaction ID's
  199. --------------------------------------------------------------*/
  200.  
  201.     kAnyTransactionID = 0,                                    /* no transaction is in use */
  202.  
  203. /*--------------------------------------------------------------
  204.         Constants for timeout durations
  205. --------------------------------------------------------------*/
  206.  
  207.      kAEDefaultTimeout = -1,                                    /* timeout value determined by AEM */
  208.      kNoTimeOut = -2                                            /* wait until reply comes back, however long it takes */
  209. };                                                            /* end of enum */
  210.  
  211. /*--------------------------------------------------------------
  212.         Constants for AEResumeTheCurrentEvent
  213. --------------------------------------------------------------*/
  214.  
  215. enum {
  216.     kAENoDispatch=  0,                                        /* dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch */
  217.     kAEUseStandardDispatch = -1,                            /* table, or one of these two constants */
  218.  
  219. /*--------------------------------------------------------------
  220.         Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch
  221. --------------------------------------------------------------*/
  222.  
  223.     kAEDoNotIgnoreHandler = 0,
  224.     kAEIgnoreAppPhacHandler = 1,                            /* available only in vers 1.0.1 and greater */
  225.     kAEIgnoreAppEventHandler = 2,                            /* available only in vers 1.0.1 and greater */
  226.     kAEIgnoreSysPhacHandler = 4,                            /* available only in vers 1.0.1 and greater */
  227.     kAEIgnoreSysEventHandler = 8,                            /* available only in vers 1.0.1 and greater */
  228.     kAEIngoreBuiltInEventHandler = 16                        /* available only in vers 1.0.1 and greater */
  229. };                                                            /* end of enum */
  230.  
  231. /*--------------------------------------------------------------
  232.         Apple event manager data types
  233. --------------------------------------------------------------*/
  234.  
  235. typedef unsigned long AEEventClass;
  236. typedef unsigned long AEEventID;
  237. typedef unsigned long AEKeyword;
  238. typedef ResType DescType;
  239.  
  240. struct AEDesc {
  241.      DescType descriptorType;
  242.      Handle dataHandle;
  243. };
  244. typedef struct AEDesc AEDesc;
  245.  
  246. struct AEKeyDesc {
  247.     AEKeyword descKey;
  248.     AEDesc descContent;
  249. };
  250. typedef struct AEKeyDesc AEKeyDesc;
  251.  
  252. typedef AEDesc AEAddressDesc;                                /* an AEDesc which contains address data */
  253. typedef AEDesc AEDescList;                                    /* a list of AEDesc's is a special kind of AEDesc */
  254. typedef AEDescList AERecord;                                /* AERecord is a list of keyworded AEDesc's */
  255. typedef AERecord AppleEvent;                                /* an AERecord that contains an AppleEvent */
  256.  
  257. typedef long AESendMode;                                    /* parameter to AESend */
  258. typedef short AESendPriority;                                /* priority param of AESend */
  259.  
  260. enum { kAEInteractWithSelf, kAEInteractWithLocal, kAEInteractWithAll };
  261. typedef unsigned char AEInteractAllowed;
  262.  
  263. enum { kAEUnknownSource, kAEDirectCall, kAESameProcess,
  264.        kAELocalProcess, kAERemoteProcess };
  265. typedef unsigned char AEEventSource;
  266.  
  267. enum { kAEDataArray, kAEPackedArray, kAEHandleArray, kAEDescArray,
  268.        kAEKeyDescArray };
  269. typedef unsigned char AEArrayType;
  270.  
  271. union AEArrayData {
  272.     short kAEDataArray[1];
  273.     char kAEPackedArray[1];
  274.     Handle kAEHandleArray[1];
  275.     AEDesc kAEDescArray[1];
  276.     AEKeyDesc kAEKeyDescArray[1];
  277. };
  278. typedef union AEArrayData AEArrayData;
  279.  
  280. typedef AEArrayData *AEArrayDataPointer;
  281.  
  282. typedef ProcPtr EventHandlerProcPtr;
  283. typedef ProcPtr IdleProcPtr;
  284. typedef ProcPtr EventFilterProcPtr;
  285.  
  286.  
  287. /*--------------------------------------------------------------
  288.         Apple event manager error messages
  289. --------------------------------------------------------------*/
  290.  
  291. enum {
  292.     errAECoercionFail = -1700,                                /* bad parameter data or unable to coerce the data supplied */
  293.     errAEDescNotFound = -1701,
  294.     errAECorruptData = -1702,
  295.     errAEWrongDataType = -1703,
  296.     errAENotAEDesc = -1704,
  297.     errAEBadListItem = -1705,                                /* the specified list item does not exist */
  298.     errAENewerVersion = -1706,                                /* need newer version of the AppleEvent manager */
  299.     errAENotAppleEvent = -1707,                                /* the event is not in AppleEvent format */
  300.     errAEEventNotHandled = -1708,                            /* the AppleEvent was not handled by any handler */
  301.     errAEReplyNotValid = -1709,                                /* AEResetTimer was passed an invalid reply parameter */
  302.     errAEUnknownSendMode = -1710,                            /* mode wasn't NoReply, WaitReply, or QueueReply or Interaction level is unknown */
  303.     errAEWaitCanceled = -1711,                                /* in AESend, the user cancelled out of wait loop for reply or receipt */
  304.     errAETimeout = -1712,                                    /* the AppleEvent timed out */
  305.     errAENoUserInteraction = -1713,                            /* no user interaction is allowed */
  306.     errAENotASpecialFunction = -1714,                        /* there is no special function for/with this keyword */
  307.     errAEParamMissed = -1715,                                /* a required parameter was not accessed */
  308.     errAEUnknownAddressType = -1716,                        /* the target address type is not known */
  309.     errAEHandlerNotFound = -1717,                            /* no handler in the dispatch tables fits the parameters to AEGetEventHandler or AEGetCoercionHandler */
  310.     errAEReplyNotArrived = -1718                            /* the contents of the reply you are accessing have not arrived yet */
  311. };
  312.  
  313. enum {                                                        /* error codes should be continued within this enum */
  314.     errAEIllegalIndex = -1719,                                /* index is out of range in a put operation */
  315.     errAEUnknownObjectType = -1731,                            /* available only in version 1.0.1 or greater */
  316.     errAERecordingIsAlreadyOn = -1732                        /* available only in version 1.0.1 or greater */
  317. };
  318.  
  319. #ifdef __cplusplus
  320. extern "C" {
  321. #endif
  322.  
  323. /**************************************************************************
  324.  The following calls apply to any AEDesc. Every 'result' descriptor is
  325.  created for you, so you will be responsible for memory management
  326.  (including disposing) of the descriptors so created. Note: purgeable
  327.  descriptor data is not supported - the AEM does not call LoadResource.  
  328. **************************************************************************/
  329.  
  330. pascal OSErr
  331. AECreateDesc( DescType typeCode, const void* dataPtr, Size dataSize, AEDesc *result )
  332.     = {0x303C,0x0825,0xA816};
  333.     
  334. pascal OSErr
  335. AECoercePtr( DescType typeCode, const void* dataPtr, Size dataSize, DescType toType,
  336.              AEDesc *result )
  337.     = {0x303C,0x0A02,0xA816}; 
  338.     
  339. pascal OSErr
  340. AECoerceDesc( const AEDesc *theAEDesc, DescType toType, AEDesc *result )
  341.     = {0x303C,0x0603,0xA816}; 
  342.     
  343. pascal OSErr
  344. AEDisposeDesc( AEDesc *theAEDesc )
  345.     = {0x303C,0x0204,0xA816};
  346.  
  347. pascal OSErr
  348. AEDuplicateDesc( const AEDesc *theAEDesc, AEDesc *result )
  349.     = {0x303C,0x0405,0xA816}; 
  350.  
  351.  
  352. /**************************************************************************
  353.   The following calls apply to AEDescList. Since AEDescList is a subtype of
  354.   AEDesc, the calls in the previous section can also be used for AEDescList.
  355.   All list and array indices are 1-based. If the data was greater than
  356.   maximumSize in the routines below, then actualSize will be greater than
  357.   maximumSize, but only maximumSize bytes will actually be retrieved.
  358. **************************************************************************/
  359.  
  360. pascal OSErr
  361. AECreateList( const void* factoringPtr, Size factoredSize, Boolean isRecord,
  362.               AEDescList *resultList )
  363.     = {0x303C,0x0706,0xA816}; 
  364.     
  365.     
  366. pascal OSErr
  367. AECountItems( const AEDescList *theAEDescList, long *theCount )
  368.     = {0x303C,0x0407,0xA816}; 
  369.     
  370. pascal OSErr
  371. AEPutPtr( const AEDescList *theAEDescList, long index, DescType typeCode,
  372.           const void* dataPtr, Size dataSize )
  373.     = {0x303C,0x0A08,0xA816};
  374.  
  375. pascal OSErr
  376. AEPutDesc( const AEDescList *theAEDescList, long index,
  377.            const AEDesc *theAEDesc )
  378.     = {0x303C,0x0609,0xA816}; 
  379.     
  380. pascal OSErr
  381. AEGetNthPtr( const AEDescList *theAEDescList, long index, DescType desiredType,
  382.              AEKeyword *theAEKeyword, DescType *typeCode, void* dataPtr,
  383.              Size maximumSize, Size *actualSize )
  384.     = {0x303C,0x100A,0xA816}; 
  385.     
  386. pascal OSErr
  387. AEGetNthDesc( const AEDescList *theAEDescList, long index, DescType desiredType,
  388.                AEKeyword *theAEKeyword, AEDesc *result )
  389.     = {0x303C,0x0A0B,0xA816}; 
  390.     
  391. pascal OSErr
  392. AESizeOfNthItem( const AEDescList *theAEDescList, long index,
  393.                  DescType *typeCode, Size *dataSize )
  394.     = {0x303C,0x082A,0xA816};
  395.  
  396. pascal OSErr
  397. AEGetArray( const AEDescList *theAEDescList, AEArrayType arrayType,
  398.             AEArrayDataPointer arrayPtr, Size maximumSize, DescType *itemType,
  399.             Size *itemSize, long *itemCount )
  400.     = {0x303C,0x0D0C,0xA816}; 
  401.     
  402. pascal OSErr
  403. AEPutArray( const AEDescList *theAEDescList, AEArrayType arrayType,
  404.             const AEArrayDataPointer *arrayPtr, DescType itemType,
  405.             Size itemSize, long itemCount )
  406.     = {0x303C,0x0B0D,0xA816};
  407.  
  408. pascal OSErr
  409. AEDeleteItem( const AEDescList *theAEDescList, long index )
  410.     = {0x303C,0x040E,0xA816}; 
  411.  
  412.  
  413. /**************************************************************************
  414.  The following calls apply to AERecord. Since AERecord is a subtype of
  415.  AEDescList, the calls in the previous sections can also be used for
  416.  AERecord an AERecord can be created by using AECreateList with isRecord
  417.  set to true. 
  418. **************************************************************************/
  419.  
  420. pascal OSErr
  421. AEPutKeyPtr( const AERecord *theAERecord, AEKeyword theAEKeyword,
  422.              DescType typeCode, const void* dataPtr, Size dataSize )
  423.     = {0x303C,0x0A0F,0xA816};
  424.     
  425. pascal OSErr
  426. AEPutKeyDesc( const AERecord *theAERecord, AEKeyword theAEKeyword,
  427.               const AEDesc *theAEDesc )
  428.     = {0x303C,0x0610,0xA816};
  429.  
  430. pascal OSErr
  431. AEGetKeyPtr( const AERecord *theAERecord, AEKeyword theAEKeyword,
  432.              DescType desiredType, DescType *typeCode, void* dataPtr,
  433.              Size maximumSize, Size *actualSize )
  434.     = {0x303C,0x0E11,0xA816};
  435.     
  436. pascal OSErr
  437. AEGetKeyDesc( const AERecord *theAERecord, AEKeyword theAEKeyword,
  438.               DescType desiredType, AEDesc *result )
  439.     = {0x303C,0x0812,0xA816};
  440.     
  441. pascal OSErr
  442. AESizeOfKeyDesc( const AERecord *theAERecord, AEKeyword theAEKeyword,
  443.                  DescType *typeCode, Size *dataSize )
  444.     = {0x303C,0x0829,0xA816};
  445.     
  446. pascal OSErr
  447. AEDeleteKeyDesc( const AERecord *theAERecord, AEKeyword theAEKeyword )
  448.     = {0x303C,0x0413,0xA816}; 
  449.  
  450.  
  451. /**************************************************************************
  452.   The following calls are used to pack and unpack parameters from records
  453.   of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
  454.   in the previous sections can also be used for variables of type
  455.   AppleEvent. The next six calls are in fact identical to the six calls
  456.   for AERecord.
  457. **************************************************************************/
  458.  
  459. pascal OSErr
  460. AEPutParamPtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  461.                DescType typeCode, const void* dataPtr, Size dataSize )
  462.     = {0x303C,0x0A0F,0xA816};
  463.     
  464. pascal OSErr
  465. AEPutParamDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  466.                 const AEDesc *theAEDesc )
  467.     = {0x303C,0x0610,0xA816};
  468.     
  469. pascal OSErr
  470. AEGetParamPtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  471.                DescType desiredType, DescType *typeCode, void* dataPtr,
  472.                Size maximumSize, Size *actualSize )
  473.     = {0x303C,0x0E11,0xA816};
  474.     
  475. pascal OSErr
  476. AEGetParamDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  477.                 DescType desiredType, AEDesc *result )
  478.     = {0x303C,0x0812,0xA816};
  479.     
  480. pascal OSErr
  481. AESizeOfParam( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  482.                DescType *typeCode, Size *dataSize )
  483.     = {0x303C,0x0829,0xA816};
  484.     
  485. pascal OSErr
  486. AEDeleteParam( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword )
  487.     = {0x303C,0x0413,0xA816}; 
  488.  
  489.  
  490. /**************************************************************************
  491.  The following calls also apply to type AppleEvent. Message attributes are
  492.  far more restricted, and can only be accessed through the following 5
  493.  calls. The various list and record routines cannot be used to access the
  494.  attributes of an event. 
  495. **************************************************************************/
  496.  
  497. pascal OSErr
  498. AEGetAttributePtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  499.                    DescType desiredType, DescType *typeCode, void* dataPtr,
  500.                    Size maximumSize, Size *actualSize )
  501.     = {0x303C,0x0E15,0xA816};
  502.     
  503. pascal OSErr
  504. AEGetAttributeDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  505.                     DescType desiredType, AEDesc *result )
  506.     = {0x303C,0x0826,0xA816};
  507.     
  508. pascal OSErr
  509. AESizeOfAttribute( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  510.                    DescType *typeCode, Size *dataSize )
  511.     = {0x303C,0x0828,0xA816};
  512.     
  513. pascal OSErr
  514. AEPutAttributePtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  515.                    DescType typeCode, const void* dataPtr, Size dataSize )
  516.     = {0x303C,0x0A16,0xA816};
  517.     
  518. pascal OSErr
  519. AEPutAttributeDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  520.                     const AEDesc *theAEDesc )
  521.     = {0x303C,0x0627,0xA816}; 
  522.  
  523.  
  524. /**************************************************************************
  525.   The next couple of calls are basic routines used to create, send,
  526.   and process AppleEvents. 
  527. **************************************************************************/
  528.  
  529. pascal OSErr
  530. AECreateAppleEvent( AEEventClass theAEEventClass, AEEventID theAEEventID,
  531.                     const AEAddressDesc *target, short returnID,
  532.                     long transactionID, AppleEvent *result )
  533.     = {0x303C,0x0B14,0xA816};
  534.     
  535. pascal OSErr
  536. AESend( const AppleEvent *theAppleEvent, AppleEvent *reply,
  537.         AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks,
  538.         IdleProcPtr idleProc, EventFilterProcPtr filterProc )
  539.     = {0x303C,0x0D17,0xA816};
  540.     
  541. pascal OSErr
  542. AEProcessAppleEvent( const EventRecord *theEventRecord )
  543.     = {0x303C,0x021B,0xA816}; 
  544.  
  545. /* 
  546.  Note: during event processing, an event handler may realize that it is likely
  547.  to exceed the client's timeout limit. Passing the reply to this
  548.  routine causes a wait event to be generated that asks the client
  549.  for more time. 
  550. */
  551.  
  552. pascal OSErr
  553. AEResetTimer( const AppleEvent *reply )
  554.     = {0x303C,0x0219,0xA816}; 
  555.  
  556.  
  557. /**************************************************************************
  558.  The following four calls are available for applications which need more
  559.  sophisticated control over when and how events are processed. Applications
  560.  which implement multi-session servers or which implement their own
  561.  internal event queueing will probably be the major clients of these
  562.  routines. They can be called from within a handler to prevent the AEM from
  563.  disposing of the AppleEvent when the handler returns. They can be used to
  564.  asynchronously process the event (as MacApp does).
  565. **************************************************************************/
  566.  
  567. pascal OSErr
  568. AESuspendTheCurrentEvent( const AppleEvent *theAppleEvent )
  569.     = {0x303C,0x022B,0xA816}; 
  570.  
  571. /* 
  572.  Note: The following routine tells the AppleEvent manager that processing
  573.  is either about to resume or has been completed on a previously suspended
  574.  event. The procPtr passed in as the dispatcher parameter will be called to
  575.  attempt to redispatch the event. Several constants for the dispatcher
  576.  parameter allow special behavior. They are:
  577.       - kAEUseStandardDispatch means redispatch as if the event was just
  578.       received, using the standard AppleEvent dispatch mechanism.
  579.       - kAENoDispatch means ignore the parameter.
  580.          Use this in the case where the event has been handled and no
  581.       redispatch is needed.
  582.       - non nil means call the routine which the dispatcher points to.
  583. */
  584.  
  585. pascal OSErr
  586. AEResumeTheCurrentEvent( const AppleEvent *theAppleEvent,
  587.                          const AppleEvent *reply,
  588.                          EventHandlerProcPtr dispatcher, long handlerRefcon )
  589.     = {0x303C,0x0818,0xA816};
  590.     
  591. pascal OSErr
  592. AEGetTheCurrentEvent( AppleEvent *theAppleEvent )
  593.     = {0x303C,0x021A,0xA816};
  594.     
  595. pascal OSErr
  596. AESetTheCurrentEvent( const AppleEvent *theAppleEvent )
  597.     = {0x303C,0x022C,0xA816}; 
  598.  
  599.  
  600. /**************************************************************************
  601.   The following three calls are used to allow applications to behave
  602.   courteously when a user interaction such as a dialog box is needed. 
  603. **************************************************************************/
  604.  
  605. pascal OSErr
  606. AEGetInteractionAllowed( AEInteractAllowed *level )
  607.     = {0x303C,0x021D,0xA816};
  608.     
  609. pascal OSErr
  610. AESetInteractionAllowed( AEInteractAllowed level )
  611.     = {0x303C,0x011E,0xA816};
  612.     
  613. pascal OSErr
  614. AEInteractWithUser( long timeOutInTicks, NMRecPtr nmReqPtr,
  615.                     IdleProcPtr idleProc )
  616.     = {0x303C,0x061C,0xA816}; 
  617.  
  618.  
  619. /**************************************************************************
  620.   These calls are used to set up and modify the event dispatch table.
  621. **************************************************************************/
  622.  
  623. pascal OSErr
  624. AEInstallEventHandler( AEEventClass theAEEventClass, AEEventID theAEEventID,
  625.                        EventHandlerProcPtr handler, long handlerRefcon,
  626.                        Boolean isSysHandler )
  627.     = {0x303C,0x091F,0xA816};
  628.     
  629. pascal OSErr
  630. AERemoveEventHandler( AEEventClass theAEEventClass, AEEventID theAEEventID,
  631.                       EventHandlerProcPtr handler, Boolean isSysHandler )
  632.     = {0x303C,0x0720,0xA816};
  633.     
  634. pascal OSErr
  635. AEGetEventHandler( AEEventClass theAEEventClass, AEEventID theAEEventID,
  636.                    EventHandlerProcPtr *handler, long *handlerRefcon,
  637.                    Boolean isSysHandler )
  638.     = {0x303C,0x0921,0xA816}; 
  639.  
  640.  
  641. /**************************************************************************
  642.   These calls are used to set up and modify the coercion dispatch table.
  643. **************************************************************************/
  644.  
  645. pascal OSErr
  646. AEInstallCoercionHandler( DescType fromType, DescType toType, ProcPtr handler,
  647.                           long handlerRefcon, Boolean fromTypeIsDesc,
  648.                           Boolean isSysHandler )
  649.     = {0x303C,0x0A22,0xA816};
  650.     
  651. pascal OSErr
  652. AERemoveCoercionHandler( DescType fromType, DescType toType, ProcPtr handler,
  653.                          Boolean isSysHandler )
  654.     = {0x303C,0x0723,0xA816};
  655.     
  656. pascal OSErr
  657. AEGetCoercionHandler( DescType fromType, DescType toType, ProcPtr *handler,
  658.                       long *handlerRefcon, Boolean *fromTypeIsDesc,
  659.                       Boolean isSysHandler )
  660.     = {0x303C,0x0B24,0xA816}; 
  661.  
  662.  
  663. /**************************************************************************
  664.   These calls are used to set up and modify special hooks into the
  665.   AppleEvent manager.
  666. **************************************************************************/
  667.  
  668. pascal OSErr
  669. AEInstallSpecialHandler( AEKeyword functionClass, ProcPtr handler,
  670.                          Boolean isSysHandler )
  671.     = {0x303C,0x0500,0xA816};
  672.     
  673. pascal OSErr
  674. AERemoveSpecialHandler( AEKeyword functionClass, ProcPtr handler,
  675.                         Boolean isSysHandler )
  676.     = {0x303C,0x0501,0xA816}; 
  677.  
  678. pascal OSErr
  679. AEGetSpecialHandler( AEKeyword functionClass, ProcPtr *handler,
  680.                      Boolean isSysHandler )
  681.     = {0x303C,0x052D,0xA816}; 
  682.  
  683.  
  684. /**************************************************************************
  685.   This call was added in version 1.0.1. If called with the keyword
  686.   keyAERecorderCount ('recr'), the number of recorders that are
  687.   currently active is returned in 'result'.
  688. **************************************************************************/
  689.  
  690. /* available only in vers 1.0.1 and greater */
  691. pascal OSErr
  692. AEManagerInfo( AEKeyword keyWord, long *result )
  693.     = {0x303C,0x0441,0xA816};
  694.  
  695.  
  696. #ifdef __cplusplus
  697. }
  698. #endif
  699.  
  700. #endif
  701.